Optimal. Leaf size=292 \[ \frac {x}{2 \sqrt {-1+\sqrt {2}}}+\frac {\text {ArcTan}\left (\frac {\left (-2+\sqrt {2}\right ) \cos (x) \sin (x)+\sqrt {-1+\sqrt {2}} \left (1-2 \sin ^2(x)\right )}{2+\sqrt {1+\sqrt {2}}+2 \sqrt {-1+\sqrt {2}} \cos (x) \sin (x)+\left (-2+\sqrt {2}\right ) \sin ^2(x)}\right )}{4 \sqrt {-1+\sqrt {2}}}+\frac {\text {ArcTan}\left (\frac {\left (-2+\sqrt {2}\right ) \cos (x) \sin (x)+\sqrt {-1+\sqrt {2}} \left (-1+2 \sin ^2(x)\right )}{2+\sqrt {1+\sqrt {2}}-2 \sqrt {-1+\sqrt {2}} \cos (x) \sin (x)+\left (-2+\sqrt {2}\right ) \sin ^2(x)}\right )}{4 \sqrt {-1+\sqrt {2}}}+\frac {1}{8} \sqrt {-1+\sqrt {2}} \log \left (\sqrt {2}-2 \sqrt {-1+\sqrt {2}} \cot (x)+2 \cot ^2(x)\right )-\frac {1}{8} \sqrt {-1+\sqrt {2}} \log \left (1+\sqrt {2 \left (-1+\sqrt {2}\right )} \cot (x)+\sqrt {2} \cot ^2(x)\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 292, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 6, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.750, Rules used = {3288, 1183,
648, 632, 210, 642} \begin {gather*} \frac {\text {ArcTan}\left (\frac {\sqrt {\sqrt {2}-1} \left (1-2 \sin ^2(x)\right )+\left (\sqrt {2}-2\right ) \sin (x) \cos (x)}{\left (\sqrt {2}-2\right ) \sin ^2(x)+2 \sqrt {\sqrt {2}-1} \sin (x) \cos (x)+\sqrt {1+\sqrt {2}}+2}\right )}{4 \sqrt {\sqrt {2}-1}}+\frac {\text {ArcTan}\left (\frac {\sqrt {\sqrt {2}-1} \left (2 \sin ^2(x)-1\right )+\left (\sqrt {2}-2\right ) \sin (x) \cos (x)}{\left (\sqrt {2}-2\right ) \sin ^2(x)-2 \sqrt {\sqrt {2}-1} \sin (x) \cos (x)+\sqrt {1+\sqrt {2}}+2}\right )}{4 \sqrt {\sqrt {2}-1}}+\frac {x}{2 \sqrt {\sqrt {2}-1}}+\frac {1}{8} \sqrt {\sqrt {2}-1} \log \left (2 \cot ^2(x)-2 \sqrt {\sqrt {2}-1} \cot (x)+\sqrt {2}\right )-\frac {1}{8} \sqrt {\sqrt {2}-1} \log \left (\sqrt {2} \cot ^2(x)+\sqrt {2 \left (\sqrt {2}-1\right )} \cot (x)+1\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 642
Rule 648
Rule 1183
Rule 3288
Rubi steps
\begin {align*} \int \frac {1}{1+\cos ^4(x)} \, dx &=-\text {Subst}\left (\int \frac {1+x^2}{1+2 x^2+2 x^4} \, dx,x,\cot (x)\right )\\ &=-\frac {\text {Subst}\left (\int \frac {\sqrt {-1+\sqrt {2}}-\left (1-\frac {1}{\sqrt {2}}\right ) x}{\frac {1}{\sqrt {2}}-\sqrt {-1+\sqrt {2}} x+x^2} \, dx,x,\cot (x)\right )}{2 \sqrt {2 \left (-1+\sqrt {2}\right )}}-\frac {\text {Subst}\left (\int \frac {\sqrt {-1+\sqrt {2}}+\left (1-\frac {1}{\sqrt {2}}\right ) x}{\frac {1}{\sqrt {2}}+\sqrt {-1+\sqrt {2}} x+x^2} \, dx,x,\cot (x)\right )}{2 \sqrt {2 \left (-1+\sqrt {2}\right )}}\\ &=\frac {1}{8} \sqrt {-1+\sqrt {2}} \text {Subst}\left (\int \frac {-\sqrt {-1+\sqrt {2}}+2 x}{\frac {1}{\sqrt {2}}-\sqrt {-1+\sqrt {2}} x+x^2} \, dx,x,\cot (x)\right )-\frac {1}{8} \sqrt {-1+\sqrt {2}} \text {Subst}\left (\int \frac {\sqrt {-1+\sqrt {2}}+2 x}{\frac {1}{\sqrt {2}}+\sqrt {-1+\sqrt {2}} x+x^2} \, dx,x,\cot (x)\right )-\frac {1}{8} \sqrt {3+2 \sqrt {2}} \text {Subst}\left (\int \frac {1}{\frac {1}{\sqrt {2}}-\sqrt {-1+\sqrt {2}} x+x^2} \, dx,x,\cot (x)\right )-\frac {1}{8} \sqrt {3+2 \sqrt {2}} \text {Subst}\left (\int \frac {1}{\frac {1}{\sqrt {2}}+\sqrt {-1+\sqrt {2}} x+x^2} \, dx,x,\cot (x)\right )\\ &=\frac {1}{8} \sqrt {-1+\sqrt {2}} \log \left (\sqrt {2}-2 \sqrt {-1+\sqrt {2}} \cot (x)+2 \cot ^2(x)\right )-\frac {1}{8} \sqrt {-1+\sqrt {2}} \log \left (1+\sqrt {2 \left (-1+\sqrt {2}\right )} \cot (x)+\sqrt {2} \cot ^2(x)\right )+\frac {1}{4} \sqrt {3+2 \sqrt {2}} \text {Subst}\left (\int \frac {1}{-1-\sqrt {2}-x^2} \, dx,x,-\sqrt {-1+\sqrt {2}}+2 \cot (x)\right )+\frac {1}{4} \sqrt {3+2 \sqrt {2}} \text {Subst}\left (\int \frac {1}{-1-\sqrt {2}-x^2} \, dx,x,\sqrt {-1+\sqrt {2}}+2 \cot (x)\right )\\ &=\frac {1}{2} \sqrt {1+\sqrt {2}} x-\frac {1}{4} \sqrt {1+\sqrt {2}} \tan ^{-1}\left (\frac {\left (2-\sqrt {2}\right ) \cos (x) \sin (x)-\sqrt {-1+\sqrt {2}} \left (1-2 \sin ^2(x)\right )}{2+\sqrt {1+\sqrt {2}}+2 \sqrt {-1+\sqrt {2}} \cos (x) \sin (x)-\left (2-\sqrt {2}\right ) \sin ^2(x)}\right )-\frac {1}{4} \sqrt {1+\sqrt {2}} \tan ^{-1}\left (\frac {\left (2-\sqrt {2}\right ) \cos (x) \sin (x)+\sqrt {-1+\sqrt {2}} \left (1-2 \sin ^2(x)\right )}{2+\sqrt {1+\sqrt {2}}-2 \sqrt {-1+\sqrt {2}} \cos (x) \sin (x)-\left (2-\sqrt {2}\right ) \sin ^2(x)}\right )+\frac {1}{8} \sqrt {-1+\sqrt {2}} \log \left (\sqrt {2}-2 \sqrt {-1+\sqrt {2}} \cot (x)+2 \cot ^2(x)\right )-\frac {1}{8} \sqrt {-1+\sqrt {2}} \log \left (1+\sqrt {2 \left (-1+\sqrt {2}\right )} \cot (x)+\sqrt {2} \cot ^2(x)\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.08, size = 45, normalized size = 0.15 \begin {gather*} \frac {\text {ArcTan}\left (\frac {\tan (x)}{\sqrt {1-i}}\right )}{2 \sqrt {1-i}}+\frac {\text {ArcTan}\left (\frac {\tan (x)}{\sqrt {1+i}}\right )}{2 \sqrt {1+i}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 167, normalized size = 0.57
method | result | size |
risch | \(\frac {\sqrt {-2+2 i}\, \ln \left ({\mathrm e}^{2 i x}-i \sqrt {-2+2 i}-\sqrt {-2+2 i}+1-2 i\right )}{8}-\frac {\sqrt {-2+2 i}\, \ln \left ({\mathrm e}^{2 i x}+i \sqrt {-2+2 i}+\sqrt {-2+2 i}+1-2 i\right )}{8}+\frac {\sqrt {-2-2 i}\, \ln \left ({\mathrm e}^{2 i x}-i \sqrt {-2-2 i}+\sqrt {-2-2 i}+1+2 i\right )}{8}-\frac {\sqrt {-2-2 i}\, \ln \left ({\mathrm e}^{2 i x}+i \sqrt {-2-2 i}-\sqrt {-2-2 i}+1+2 i\right )}{8}\) | \(126\) |
default | \(-\frac {\sqrt {2}\, \left (-\frac {\sqrt {-2+2 \sqrt {2}}\, \ln \left (\tan ^{2}\left (x \right )-\tan \left (x \right ) \sqrt {-2+2 \sqrt {2}}+\sqrt {2}\right )}{2}+\frac {2 \left (-1-\sqrt {2}\right ) \arctan \left (\frac {2 \tan \left (x \right )-\sqrt {-2+2 \sqrt {2}}}{\sqrt {2 \sqrt {2}+2}}\right )}{\sqrt {2 \sqrt {2}+2}}\right )}{8}-\frac {\sqrt {2}\, \left (\frac {\sqrt {-2+2 \sqrt {2}}\, \ln \left (\tan ^{2}\left (x \right )+\tan \left (x \right ) \sqrt {-2+2 \sqrt {2}}+\sqrt {2}\right )}{2}+\frac {2 \left (-1-\sqrt {2}\right ) \arctan \left (\frac {2 \tan \left (x \right )+\sqrt {-2+2 \sqrt {2}}}{\sqrt {2 \sqrt {2}+2}}\right )}{\sqrt {2 \sqrt {2}+2}}\right )}{8}\) | \(167\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 3830 vs.
\(2 (219) = 438\).
time = 18.44, size = 3830, normalized size = 13.12 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.54, size = 170, normalized size = 0.58 \begin {gather*} \frac {1}{4} \, {\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor + \arctan \left (\frac {2^{\frac {3}{4}} {\left (2^{\frac {1}{4}} \sqrt {-\sqrt {2} + 2} + 2 \, \tan \left (x\right )\right )}}{2 \, \sqrt {\sqrt {2} + 2}}\right )\right )} \sqrt {\sqrt {2} + 1} + \frac {1}{4} \, {\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor + \arctan \left (-\frac {2^{\frac {3}{4}} {\left (2^{\frac {1}{4}} \sqrt {-\sqrt {2} + 2} - 2 \, \tan \left (x\right )\right )}}{2 \, \sqrt {\sqrt {2} + 2}}\right )\right )} \sqrt {\sqrt {2} + 1} - \frac {1}{8} \, \sqrt {\sqrt {2} - 1} \log \left (\tan \left (x\right )^{2} + 2^{\frac {1}{4}} \sqrt {-\sqrt {2} + 2} \tan \left (x\right ) + \sqrt {2}\right ) + \frac {1}{8} \, \sqrt {\sqrt {2} - 1} \log \left (\tan \left (x\right )^{2} - 2^{\frac {1}{4}} \sqrt {-\sqrt {2} + 2} \tan \left (x\right ) + \sqrt {2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.73, size = 214, normalized size = 0.73 \begin {gather*} \mathrm {atanh}\left (\frac {4\,\sqrt {2}\,\mathrm {tan}\left (x\right )\,\sqrt {-\frac {\sqrt {2}}{64}-\frac {1}{64}}}{64\,\sqrt {\frac {\sqrt {2}}{64}-\frac {1}{64}}\,\sqrt {-\frac {\sqrt {2}}{64}-\frac {1}{64}}-1}+\frac {4\,\sqrt {2}\,\mathrm {tan}\left (x\right )\,\sqrt {\frac {\sqrt {2}}{64}-\frac {1}{64}}}{64\,\sqrt {\frac {\sqrt {2}}{64}-\frac {1}{64}}\,\sqrt {-\frac {\sqrt {2}}{64}-\frac {1}{64}}-1}\right )\,\left (2\,\sqrt {-\frac {\sqrt {2}}{64}-\frac {1}{64}}-2\,\sqrt {\frac {\sqrt {2}}{64}-\frac {1}{64}}\right )-\mathrm {atanh}\left (\frac {4\,\sqrt {2}\,\mathrm {tan}\left (x\right )\,\sqrt {-\frac {\sqrt {2}}{64}-\frac {1}{64}}}{64\,\sqrt {\frac {\sqrt {2}}{64}-\frac {1}{64}}\,\sqrt {-\frac {\sqrt {2}}{64}-\frac {1}{64}}+1}-\frac {4\,\sqrt {2}\,\mathrm {tan}\left (x\right )\,\sqrt {\frac {\sqrt {2}}{64}-\frac {1}{64}}}{64\,\sqrt {\frac {\sqrt {2}}{64}-\frac {1}{64}}\,\sqrt {-\frac {\sqrt {2}}{64}-\frac {1}{64}}+1}\right )\,\left (2\,\sqrt {-\frac {\sqrt {2}}{64}-\frac {1}{64}}+2\,\sqrt {\frac {\sqrt {2}}{64}-\frac {1}{64}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________